Tree

A tree that represents the syntactic structure of a source code file.

Constructors

this
this(TSTree* tstree)

Create a new Tree

this
this(Tree otherTree)

Create a shallow copy of the syntax tree. This is very fast.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

changed_ranges
auto changed_ranges(Tree other)

Compare this old edited syntax tree to a new syntax tree representing the same document, returning a sequence of ranges whose syntactic structure has changed.

dot_graph
auto dot_graph()

Get a DOT graph describing the syntax tree as a string

edit
auto edit(InputEdit* edit)

Edit the syntax tree to keep it in sync with source code that has been edited.

language
auto language()

Get the language that was used to parse the syntax tree.

print_dot_graph
void print_dot_graph(File file)

Write a DOT graph describing the syntax tree to the given file.

root_node
auto root_node()

Get the root node of the syntax tree.

traverse
void traverse(TreeVisitor visitor)

Traverse the Tree starting from its root Node applying a visitor at all nodes.

traverse_nothrow
void traverse_nothrow(TreeVisitor visitor)

Traverse the Tree starting from its root Node applying a visitor at all nodes.

walk
auto walk()

Create a new TreeCursor starting from the root of the tree.

Static functions

create_empty
auto create_empty()

Create an empty Tree

Variables

tstree
TSTree* tstree;

internal TsTree

Meta